package com.canaan.business.common.enums.basic;

/**
 * 条码规则枚举
 */
public enum CodeRulePropertyEnum {

    SERIAL_NUM("SERIAL_NUM", "流水号"),
    SYSTEM_TIME("SYSTEM_TIME", "系统时间"),
    PRODUCT_NO("PRODUCT_NO", "物料编码"),
    ;

    private final String code;
    private final String message;

    CodeRulePropertyEnum(String code, String info) {
        this.code = code;
        this.message = info;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(String code) {
        if (code == null) {
            return null;
        }
        String message = null;
        for (CodeRulePropertyEnum value : values()) {
            if (value.getCode().equals(code)) {
                message = value.getMessage();
                break;
            }
        }
        return message;
    }
}
